<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>workers</title>
</head>
<body>
<button id="button">按钮</button>
<script src="./worker-01-multiple.js"></script>
<script>
  const __worker = useWorker({
    new() {
      return 'new: -> thing'
    },
    add() {
      return 'add: -> thing'
    },
    delete() {
      return 'delete: -> thing'
    },
    remove() {
      return 'remove: -> thing'
    },
  });

  __worker.new().then(res => {
    console.log('-----new:result-----', res)
  })
  console.log('new sync')

  setTimeout(() => {
    __worker.add().then(res => {
      console.log('-----add:result-----', res)
    })
    console.log('add sync')
  }, 5000)

  setTimeout(() => {
    __worker.delete().then(res => {
      console.log('-----delete:result-----', res)
    })
    console.log('delete sync')
  }, 10000)

  setTimeout(() => {
    __worker.remove().then(res => {
      console.log('-----remove:result-----', res)
    })
    console.log('remove sync')
  }, 15000)

  /*worker.add().then(res => {})
  worker.add().then(res => {})
  worker.add().then(res => {})
  worker.add().then(res => {})*/
</script>
</body>
</html>
